#include <iostream>
#include <vector>
#include <string>
#include <deque>
#include <algorithm>
using namespace std;


class Person{
public:
    Person(string name,double score)
    :_name(name)
    ,_score(score)
    {}
    string _name;
    double _score;//存放平均分
};

float generate_score(){
    return rand() % 41 + 60;
}

void test(){
    vector<Person> vec1{
        Person("xiongda",0),
        Person("xionger",0),
        Person("gtq",0),
        Person("jjgw",0),
        Person("tiaotiao",0),
    };
    int judge_num = 10;
    for(auto & p : vec1){
        deque<double> dq;
        for(int i =0;i<judge_num;++i){
            dq.push_back(generate_score());
        }
        sort(dq.begin(),dq.end());
        //cout << "对选手"<< p._name << "的评分:"<< endl;
        //for(auto ss:dq){
        //    cout << ss << " ";
        //}
        //cout << endl;
        dq.pop_back();
        dq.pop_front();
        float sum = 0;
        for(float i : dq){
            sum += i;
        }
        p._score = sum/(judge_num-2);
    }
    for(auto p : vec1){
        cout << p._name<<":" << p._score << endl;
    }
}

int main()
{
    

    test ();
    return 0;
}

